package com.csr.csrcheck.controller;

import com.csr.csrcheck.pojo.Actual_controller;
import com.csr.csrcheck.service.Actual_controllerService;
import com.csr.csrcheck.service.ex.Actual_controllerException;
import com.csr.csrcheck.util.JsonResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@RequestMapping({"actual_controller"})
@RestController
public class Actual_controllerController extends BaseController {
    private static final Logger log = LoggerFactory.getLogger(com.csr.csrcheck.controller.Actual_controllerController.class);

    @Resource
    private Actual_controllerService actual_controllerService;

    @GetMapping({"actual_controllerlist"})
    public JsonResult<List<Actual_controller>> Flight_checklist(HttpServletResponse response) throws IOException, ServletException {
        List<Actual_controller> list = this.actual_controllerService.getActual_controllerlist();
        if (list == null)
            throw new Actual_controllerException("");
        return new JsonResult(Integer.valueOf(0), "json", list);
    }
}
